<template>
	<view>
		<view class="w100 flex-center" @click="lot">
			<image style="width: 240rpx;height: 240rpx;border-radius: 50%;" :src="avter" mode="aspectFill"></image>
		</view>
		<view class="flex-b w100 mt-80" @click="step('修改昵称')">
			<view style="display: flex;align-items: center; ">
				<view class="s3 ml-20" style="font-size: 28rpx;">
					我的昵称
				</view>
			</view>
			<view style="display: flex;align-items: center;">
				<view class="size mr-20">
					{{nickname}}
				</view>
				<u-icon name="arrow-right" color="rgba(120, 130, 142, 1)" size="16"></u-icon>
			</view>

		</view>
		<view class="flex-b w100 mt-80" @click="step('修改登陆密码')">
			<view style="display: flex;align-items: center; ">
				<view class="s3 ml-20" style="font-size: 28rpx;">
					登陆密码
				</view>
			</view>
			<view style="display: flex;align-items: center;">

				<u-icon name="arrow-right" color="rgba(120, 130, 142, 1)" size="16"></u-icon>
			</view>

		</view>
		<view class="flex-b w100 mt-80" @click="step('修改交易密码')">
			<view style="display: flex;align-items: center; ">
				<view class="s3 ml-20" style="font-size: 28rpx;">
					交易密码
				</view>
			</view>
			<view style="display: flex;align-items: center;">

				<u-icon name="arrow-right" color="rgba(120, 130, 142, 1)" size="16"></u-icon>
			</view>

		</view>
		<view class="flex-b w100 mt-80">
			<view style="display: flex;align-items: center; ">
				<view class="s3 ml-20" style="font-size: 28rpx;">
					手机号
				</view>
			</view>
			<view style="display: flex;align-items: center;">
				<view class="size mr-20">
					{{user_phone}}
				</view>

			</view>

		</view>
		<view class="flex-b w100 mt-80" @click="step('查看钱包地址')">
			<view style="display: flex;align-items: center; ">
				<view class="s3 ml-20" style="font-size: 28rpx;">
					查看钱包地址
				</view>
			</view>
			<view style="display: flex;align-items: center;">
				<view class="size mr-20">
					{{my_address | addressFilter}}
				</view>
				<u-icon name="arrow-right" color="rgba(120, 130, 142, 1)" size="16"></u-icon>
			</view>

		</view>
		<view class="s1 but  w100" @click="tologo">
			退出账号
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				avter: '',
				nickname: '',
				user_phone: '',
				my_address: ''
			}
		},
		onShow() {
			this.usinfo()
		},
		filters: {
			addressFilter(str) {
				return str ? str.replace(/(\d{5})\d*(\d{5})/, '$1****$2') : ''
			}
		},
		methods: {
			async usinfo() {
				let res = await this.$http.get('user/get_user_info', {

				})
				if (res) {
					uni.setStorageSync('usinfo', res.data)

					this.avter = res.data.headimgurl
					this.nickname = res.data.nickname
					this.user_phone = res.data.user_phone
					this.my_address = res.data.my_address
				}
			},
			lot() {
				uni.navigateTo({
					url: '/pages/uset/step/sculpture?url=' + this.avter
				})
			},
			step(name) {
				uni.navigateTo({
					url: '/pages/uset/step/steps?name=' + name
				})
			},
			tologo() {
				uni.clearStorage()
				uni.navigateTo({
					url: '/pages/login/login'
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #1E2240;
		padding: 30rpx 50rpx;
	}

	.size {
		font-size: 32rpx;
		font-weight: 400;


		color: rgba(147, 149, 164, 1);
	}

	.s3 {
		font-size: 32rpx;
		font-weight: 400;
		color: #fff;
	}

	.s1 {
		font-size: 30rpx;
		font-weight: 600;
		color: #fff;
	}

	.but {

		height: 100rpx;

		border-radius: 28rpx;
		background: rgba(255, 49, 74, 1);
		display: flex;
		justify-content: center;
		align-items: center;

		margin-top: 240rpx;
	}
</style>